溝通管理API
獲取聯繫人列表
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object<result> | Body | 返回結果 |
result說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| family_name | String | Body | 家庭名稱 |
| sip_group | String | Body | SIP羣組號 |
| devices | []Object<device> | Body | 設備信息 |
| accounts | []Object<account> | Body | 賬號信息 |
| akuvox_devices | []Object<akuvox_device> | Body | Akuvox設備信息 |
| ciphertext | String | Body | 密文,依賴SDK解析 |
device說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| device_id | String | Body | 設備ID |
| device_name | String | Body | 設備名稱 |
| mac | String | Body | MAC地址 |
| sip | String | Body | SIP號 |
account說明
| 參數名 | 類型 | 位置 | 說明 | 說明 |
|---|---|---|---|---|
| account_id | String | Body | 賬號ID | 賬號ID |
| account_name | String | Body | 賬號名稱 | |
| first_name | String | Body | 名 | |
| last_name | String | Body | 姓 | |
| String | Body | 郵箱 | ||
| sip | String | Body | SIP號 | |
| main_sip | String | Body | 主SIP號 |
akuvox_device說明
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| device_name | String | Body | 設備名稱 |
| mac | String | Body | MAC地址 |
| sip | String | Body | SIP號 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_contact_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
}
成功返回示例
狀態碼:200
{
"success": true,
"timestamp": 1540869200562,
"result": {
"family_name": "my home",
"sip_group": "1251318313",
"ciphertext": "7b3d75f5a8cfa959167852468fca08a3",
"devices": [
{
"device_id": "d1d54e460365949109ec306dc6e37679b",
"device_name": "51",
"mac": "0C110532D242",
"sip": "123132312"
}
],
"accounts": [
{
"account_id": "a1d54e460365949109ec306dc6e37679b",
"account_name": "demo@akubela.com",
"first_name": "tom",
"last_name": "fly",
"email": "demo@akubela.com",
"sip": "423143312",
"main_sip": "423143312"
}
],
"akuvox_devices": [
{
"device_name": "door",
"mac": "0C110532D246",
"sip": "223132812"
}
]
}
}
失敗返回示例
見 接口失敗返回
上報溝通消息
接口地址
POST /api/v1.0/invoke/open-ability/method/user-commands
請求參數
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| Content-Type | String | Header | 是 | 內容類型,值爲application/json |
| Accept | String | Header | 是 | 接受類型,值爲application/json |
| Authorization | String | Header | 是 | Bearer認證,訪問令牌 |
| command | String | Body | 是 | 命令名稱 |
| id | String | Body | 是 | 命令ID |
| param | Object<param> | Body | 是 | 命令參數 |
param說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| residence_id | String | Body | 是 | 住宅ID |
| communication_messages | []Object<communication_message> | Body | 是 | 溝通信息 |
communication_message說明
| 參數名 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
| communicate_id | String | Body | 是 | 溝通ID |
| timestamp | Integer | Body | 是 | 時間戳 |
| from | String | Body | 是 | 發送方ID 賬號ID:發送方爲用戶 設備ID:發送方爲設備 |
| to | String | Body | 是 | 接收方ID 住宅ID:對家庭下的用戶與設備羣發 賬號ID:接收方爲用戶 |
| format | String | Body | 是 | 消息格式 text:文本 voice:語音 |
| content | String | Body | 是 | 消息內容 text:文本內容 voice:語音文件文件名 |
| duration | Integer | Body | 否 | 語音時長,單位:秒 |
返回參數
| 參數名 | 類型 | 位置 | 說明 |
|---|---|---|---|
| Content-Type | String | Header | 內容類型,值爲application/json |
| success | Boolean | Body | 判斷請求是否成功 true:成功 false:失敗 |
| timestamp | Integer | Body | 時間戳 |
| result | Object | Body | 返回結果 |
請求示例
POST /api/v1.0/invoke/open-ability/method/user-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "report_communication_message",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"communication_messages": [
{
"communicate_id": "c6e3861d5d4ca4dcd8e76d84f1ecd49b9",
"timestamp": 193239428274,
"from": "a1d54e460365949109ec306dc6e37679b",
"to": "a42bdd7f6cb5ad478f3471539c2547b42",
"format": "voice",
"content": "f92c1118be3524f84bf59051cc1255f3d",
"duration": 15
}
]
}
}
成功返回示例
狀態碼:200
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
失敗返回示例
見 接口失敗返回